主题
启动共享内存远程调度服务 - StartRemoteServerShm
函数简介
在 B 端 使用本机共享内存队列建立远程调度通道(不经 TCP)。
接口名称
StartRemoteServerShmDLL调用
c
int64_t StartRemoteServerShm(int64_t instance, char* token);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug 对象指针,由 CreateCOLAPlugInterFace 接口生成。 |
| token | 字符串 | 鉴权方式与 TCP 版一致; |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
long handle = ola.StartRemoteServerShm("value");csharp
using OLAPlug;
var ola = new OLAPlugServer();
long handle = ola.StartRemoteServerShm("value");python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
handle = ola.StartRemoteServerShm("value")java
import com.olaplug.OLAPlugServer;
OLAPlugServer ola = new OLAPlugServer();
long handle = ola.StartRemoteServerShm("value");cpp
var ola = com("OlaPlug.OlaSoft")
var handle = ola.StartRemoteServerShm("value")vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
handle = ola.StartRemoteServerShm("value")text
.局部变量 ola, OLAPlug
ola.创建 ()
handle = ola.StartRemoteServerShm("value")aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var handle = ola.StartRemoteServerShm("value");text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
长整数 handle = ola.StartRemoteServerShm("value")cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
long handle = ola.StartRemoteServerShm("value");原生 DLL 调用
cpp
StartRemoteServerShm(instance, "value");csharp
using System.Runtime.InteropServices;
using System.Text;
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int StartRemoteServerShm(long ola, string token);
StartRemoteServerShm(instance, "value");python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.StartRemoteServerShm(instance, "value")返回值
服务句柄:大于 0 表示成功,0 表示失败。
注意事项
- 仅 B 端调用;与 启动远程调度服务 - StartRemoteServer 一样,每个
instance通常只保留一个服务。 - A 端使用 通过共享内存连接远程服务端 - ConnectRemoteShm 或 ConnectRemoteShmEx 连接。
- 停止服务使用 停止远程调度服务 - StopRemoteServer。
